﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Empires.BLL.Core.IService;
using Empires.RAL.Access;
using Empires.RAL.Pump;
using Empires.CRL.DataContract;


namespace Empires.BLL.Core.Implement
{
    public class CompanySettingService : ICompanySettingService
    {
        public string GetTitleAndKeyWord(string copName)
        {
            ICompanySettingAccess company = new CompanySettingDataPump();
            return company.GetTitleAndKeyWord(copName);
        }


        public List<DefaultDataPack> GetLogoInfo(string copName)
        {
            ICompanySettingAccess company = new CompanySettingDataPump();
            return company.GetLogoInfo(copName);
        }

        public List<DefaultDataPack> GetScrollImgs(string copname, int take)
        {
            List<DefaultDataPack> list = new List<DefaultDataPack>();
            ICompanySettingAccess company = new CompanySettingDataPump();
            list = company.GetScrollImgs(copname, take);
            //var pack = company.GetScrollImgs(copname, take);
            //List<ScrollImg> objs = CRL.Tools.SerializerLib.JsonDeserialize<List<ScrollImg>>(pack.FirstOrDefault().CONTENT.Replace("\n",""));
            //foreach (var item in objs)
            //{
            //    list.Add(
            //        new DefaultDataPack()
            //        {
            //            URL = item.url,
            //            TITLE = item.title
            //        });
            //}
            return list;
        }
    }
}
